Control method for robots

ABSTRACT

When a welding teaching program employing a plurality of robots is completed, if a robot does not operate properly it may be preferably to make the robot retreat and operate in accordance with a different teaching program, urgently and at an optional timing. In the invention, when the operation of a program being executed is suspended, the program addresses are memorized and a different prestored teaching program is executed. Upon the termination of the different teaching program, the execution of the suspended program is resumed, referring to the memorized addresses.

FIELD OF ART

The present invention relates to an execution method of a teachingprogram for a robot.

BACKGROUND OF THE INVENTION

A large number of execution methods of teaching programs for robots arecalled a sequential program method in which instructions are executed inthe order of registration of instructions registered in a teachingprogram taught by an operator. During the execution of a teachingprogram, if a different teaching program is to be executed, a callinstruction for calling the different teaching program will beregistered in the teaching program and when the call instruction isexecuted the different program is executed.

In the prior art, when a different teaching program is to be executedduring the execution of a teaching program, a call instruction has to beregistered beforehand, and further instructions in the teaching programare executed in due order and when the call instruction is executed, thedifferent teaching program is executed. Therefore, a different teachingprogram can be executed only in a position fixed in the execution of theteaching program, and a different teaching program is not capable ofbeing executed in an optional position in the teaching program.

For example, when a robot is operated in a welding work operating ateaching program, it is impossible to make it retreat by urgentlyoperating a different teaching program at an optional point.

Such necessity occurs when a plurality of robots are working incooperation, one of the robots goes wrong, and the other robots arerequested to stop operating.

The present invention of is directed to such circumstances and providesan execution method of a teaching program which can execute a differentteaching program by the input of an interrupt input signal at anoptional position during the execution of the teaching program.

SUMMARY OF THE INVENTION

To achieve the above-mentioned object, the control method of robotsaccording to the present invention is constituted as shown in thefollowing: in the execution of a teaching program for a robot, when theexecution of a program being executed is interrupted by a signal inputduring the execution of a teaching program, the execution addresses ofthe program being executed are stored and a different program setbeforehand is executed, and when the execution of the different programis terminated the execution of the interrupted teaching program isresumed referring to the stored addresses.

In the above-mentioned method, a plurality of different teachingprograms can be selected by using different kinds of input signals.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a block diagram showing the execution of an interrupt teachingprogram;

FIG. 2 is a flow chart showing an example of a deciding process programfor an interrupt signal, which is a part of the process of an interruptsignal decision task shown in the execution block diagram of aninterruption teaching program;

FIG. 3 is a block diagram showing an example of a hardware constitutionin which the above-mentioned interrupt teaching program is operated.

DESCRIPTION OF THE PREFERRED EMBODIMENT

In the following, the present invention will be concretely explainedbased on an embodiment.

FIG. 1 is a block diagram showing an embodiment of the presentinvention. The present invention is constituted with software in fact,but in the present embodiment it is expressed as if it were constitutedwith hardware to facilitate understanding.

In FIG. 1, 1 is a clock pulse generator for starting an interrupt signaldecision task 2 in a fixed cycle, 3 is an interrupt decision table fordeciding an input signal to be allotted to the interruption of interruptnumbers 1 to i, 4 is a teaching program allotment portion for allottinga teaching program to each of the interruptions 1 to i decided by theinterrupt signal decision task 2, 5 is a teaching program name allotmenttable in which teaching program names are allotted to interrupt numberswhich are referred to by the teaching program allotment portion 4.

When a normal program is being executed, the instructions of teachingprograms stored in a memory space of the teaching program data storingmemory 7 are read out sequentially in the order of m-2, m-1, m, m+1 by ateaching data readout portion 12, and they are sent to a switchingportion 9. In the switching portion 9, when there is no occurrence ofinterruption, as the switch is set at EXEC the data are sent to aswitching portion 10. When there is no occurrence of interruption theswitch in the switching portion 10 is also set at EXEC, so that theprogram is sent to an analytical execution portion 11. In the analyticalexecution portion 11, the instruction sent from the switching portion 10is deciphered and executed.

The interrupt signal decision task 2 which is started in a fixed cycleby the clock pulse generator 1 constantly monitors input signals 1 to N.When an input signal is input, the interrupt signal decision task 2checks if the input signal coincides with one of the input signalsallotted to interrupt numbers of i pieces, 1 to i, referring to theallotment decision table 3 and also checks if the interrupt number isnot invalid. If the input signal number is allotted to any one among ipieces of interrupt signals and it is also valid, the interrupt signalallotted to the input signal is sent to the teaching program allotmentportion 4. In the teaching program allotment portion 4, a teachingprogram name which corresponds to the interrupt number sent from theinterrupt signal decision task 2 is decided referring to the collationtable in the teaching program name allotment table 5, and it is sent toa stored address output portion 6. Further the switching portions 9 and10 are informed of the occurrence of interruption. In the switchingportion 9, an internal switch is change over to SAVE; the address m ofan instruction A in a teaching program being executed on the memoryspace in the teaching program data storing memory 7, in which a teachingprogram is stored, is stored in an address storing register 8. At thistime, if the teaching program name corresponding to the interrupt numberis not found, an alarm is given and a teaching program being executed issuspended, and a warning is given to an operator.

In the stored address output portion 6, a teaching program name sentfrom the teaching program name allotment table 5 is converted to thestoring address of an instruction at the top of a teaching program ofthe teaching program name sent from the program name allotment table 5on the memory space in the teaching program data storing memory 7, andit is sent to a different teaching data read out portion 13. In thedifferent teaching data readout portion 13, an instruction A at the topof the interrupt program is read out from the memory space in the memory7 designated by an storing address n sent from the storing addressoutput portion 6, and it is sent to the switching portion 10. Theswitching portion 10 which has been informed of the occurrence ofinterruption from the teaching program allotment portion 4 sets theprogram switch at INT, so that the instruction A read out by the addressstoring register 8 is sent to the analytical execution portion 11. Theanalytical execution portion 11 deciphers the instruction and executeit. Following this, the different teaching data readout portion 13sequentially reads out addresses in order of n, n+1, n+2, - - - , andthey are sent to the analytical execution portion 11 through theswitching portion 10, and they are deciphered and executed.

At the end of a teaching program, END instruction, which shows the endof the instruction, is registered, and the different teaching datareadout portion 13 reads out the instruction and when it is executed inthe analytical execution portion 11, the analytical execution portion 11informs the switching portions 9 and 10 of the end of the instruction.The switching portion 9 reads out the address m, the address at the timeof the occurrence of interruption, stored in the address storingregister 8 and informs the teaching data readout portion 12 of theaddress. The teaching data readout portion 12 sends and instruction A inthe address m, the address at the time of the occurrence ofinterruption, to the switching portion 9.

In the switching portion 9, the program switch is again change over toEXEC being informed of the termination of interruption from theanalytical execution portion 11, so that the switching portion 9 sendsthe instruction A at the address m to the switching portion 10. IN theswitching portion 10 too, the switch is again changed over to EXEC beinginformed of the termination of interruption from the analyticalexecution portion 11, so that the address data are read out form theaddress m, the address at the resumption after the suspension, in orderof m+1, m+2, - - - , and they are sent to the analytical executionportion 11 through the switching portions 9 and 10; they are decipheredand executed therein and the teaching program is executed in the stateas before the occurrence of interruption.

In FIG. 1, the portions, from the interrupt signal decision task 2 tothe different teaching data readout portion 13, are explained as if theyare constituted with hardware, but they can be realized with a programof software.

For example, FIG. 2 is a flow chart when the interrupt signal decisiontask 2 shown in FIG. 1 is realized with a program of software. FIG. 3shows the hardware for realizing software for the above-mentionedprogram. In FIG. 3, MCPU 301 is a central processing device whichcontrols the actions of robots. PCPU 302 is a CPU which performs theinterface between an operator and a robot control device; a keyboard andCRT are connected the PCPU 302. Two-port CMOS 303 is a memory to be readand written from both CPU's, MCPU 301 and PCPU 302. A portion 304 is aclock pulse generator which generates interruptions at a fixed cycle tothe MCPU 301; 305 is an IOCPU for monitoring the state of input/outputsignals; 306 is a memory for storing the state of input/output signals,and with the start of the interrupt signal decision task in step 200 inthe flow chart in FIG. 2, the state of input signals is transmitted tothe input signal state area 310 of 2-port CMOS 303; 307 is aninput/output portion.

When an interruption is generated to the MCPU 301 by the clock pulsegenerator 304, the interrupt signal decision task is started. The taskcalled an interrupt signal decision task, but besides the processingprogram for an interrupt signal decision, a processing program forcontrolling robots is also operated. Therefore, when the interruptsignal decision task is started, immediately or after another controlprocessing program for a robot which is not an interrupt signal decisionprocessing is terminated, the interrupt signal decision processingprogram is operated. When an interrupt signal decision processingprogram is operated, the first transition of an input signal registeredin the allotment decision table is decided in steps 201 to 207 shown inFIG. 2. In step 201, it is decided if the input signal number isregistered in the allotment decision table by reading the data in theallotment table formed on the 2-port CMOS 303. If it is not registered,the interrupt signal decision processing program is terminated.

If it is registered, in step 202 an initial value 1 is set at aninterrupt number counter i, and from the interrupt number No. 1 in theallotment decision table the first transition of the registered inputsignal is detected.

Next, in step 203, it is decided if the number of an input signal isregistered in No. 1 in the allotment decision table by reading the inputsignal data in the allotment decision table formed on the 2-port CMOS303. If it is not registered, step 211 is selected with a jump. If it isregistered, step 204 is selected.

In step 204, it is decided if a mask is designated in No. i in theallotment decision table by reading the mask data in the allotmentdecision table formed on the 2-port CMOS 303. If the mask is designated,step 211 is selected with a jump. If the mask is not designated, step205 is selected.

In step 205, it is decided if the input signal having the number of theregistered input signal is in an ON state by reading the input signalstate area 310 to which the state of an input signal is transferred instep 200. If the input signal is not in an ON state, step 206 isselected.

In step 206, "0" is set in the No. i position in the present time inputsignal state area 311 on the 2-port CMOS, and then step 210 is selectedwith a jump. If the input signal is in a ON state, step 207 is selected.

In step 207, "1" is set in the No. i position in the present time inputsignal state area 311 on the 2-port CMOS, and step 208 is selected.

In step 208, the signal state in No. i position in the last time inputsignal state area 312 on the 2-port CMOS 303 is read and the state isdecided if it is a first transition of an input signal. In this time,the state is in an ON state, so that if the last time input state is notin an ON state, the state is decided to indicate the first transition ofan input signal. About the last time input signal state area 312 will beexplained later. If the state is decided not to be indicating a firsttransition of an input signal, step 210 is selected. If a firsttransition of an input signal is detected, step 209 is selected.

In step 209, an ON state is set in No. i position of an first transitiondetection area 313 on the 2-port CMOS, and step 210 is selected.

In step 210, the data in No. i position of the present time input signalstate area 311 on the 2-port CMOS 303 are transferred to No. i positionof the last time input signal state area 312 on the 2-port CMOS 303, andthen step 211 is selected.

In step 211, it is decided if the interrupt decision table is reached anend. For example, if the end of the interrupt decision table isinterruption No. 8, the table reaches to an end at i=8 and an interruptsignal decided process program is terminated. If the interrupt decisiontable is not terminated in step 211, step 212 is selected.

In step 212, 1 is added to the interrupt number counter i to come backto step 203, and the first transition of an input signal registered inthe interrupt number counter i+1 is decided. Following this, theoperation is repeated until the interrupt decision table is terminated.

As described in the above, in detecting the interrupt number registeredin the interrupt decision table which corresponds to an input signalwhich has been built up from an off state, and the number is transferredto the teaching program allotment portion as an interrupt number inwhich an interruption is generated.

As mentioned in the above, in the present invention, during theexecution of a teaching program, a different teaching program can beexecuted at an optional point with an interrupt signal, and after theexecution of the different teaching program is terminated, the executionof the original teaching program is resumed from the address at whichthe execution is suspended.

Owing to this, during the operation of robots, retreating actions etc.can be performed urgently calling another job at an optional timing, andafter the termination of these actions the original operation can beresumed. This is especially effective for the management of troubles.

The present invention can be utilized for the management of problems ofindustrial robots when they are included in a system.

We claim:
 1. A method for controlling a plurality of robots in anoperation of a teaching program, comprising the steps of:controlling arobot using a given teaching program having a sequence of program stepsstored at a plurality of addresses; storing a different teaching programin a first memory; suspending of the operation of said teaching programin response to a signal input during the execution of the teachingprogram; storing a first address of a program step of the teachingprogram at the time of receipt of said signal, in a second memory;controlling said robot in accordance with said different teachingprogram in response to said signal; and resuming the controlling of saidrobot with said teaching program, starting with the program step at saidstored first address, upon the termination of said different program. 2.The method for controlling robots according to claim 1 comprisingstoring a plurality of additional different teaching programs, andselecting predetermined ones of said plurality of said additionaldifferent teaching programs by different kinds of inputsignals:suspending the operation of said teaching program in response tosaid different kinds of signals input during the execution of theteaching program; storing a second address of a second program step ofthe teaching program at the time of receipt of said different kinds ofinput signals; selectively controlling said robot in accordance with theselected one of said different teaching programs in response to saiddifferent kinds of input signals; and resuming the controlling of saidrobot with said teaching program, starting with the second program stepat said stored second address, upon the termination of said furtherdifferent program.